package edu.boun.g4.coursity.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @author mertusta
 * @author bulutkorkmaz
 * @author sebnemarslan
 */
@Entity
@Table(name = "COURSE")
public class Course implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "COURSE_ID")
	@GeneratedValue
	private Integer courseId;

	@Column(name = "COURSE_NAME")
	private String courseName;

	@Column(name = "RATING")
	private Integer rating;

	@Column(name = "COURSE_DESCRIPTION", columnDefinition = "TEXT")
	private String courseDescription;

	@ManyToOne
	private Initiative initiative;

	@ManyToOne
	private Institution institution;

	@ManyToOne
	private Instructor instructor;

	@ManyToMany(fetch = FetchType.EAGER)
	private Set<SemanticTag> categories;

	// @ManyToMany(fetch = FetchType.EAGER)
	@Column(name = "LANGUAGE")
	private String languages;

	@OneToMany(fetch = FetchType.EAGER)
	private Set<Comment> comments;
	
	/*
	@OneToMany(fetch = FetchType.EAGER)
	private Set<Rating> ratings;
	
	*/
	
	@Column(name = "STARTTING_DATE")
	private String startingDate;

	@Column(name = "INFO")
	private String info;

	@Column(name = "URL")
	private String url;

	@Column(name = "LENGTH")
	private String length;

	@Column(name = "ESTIMATED_EFFORT")
	private String estimatedEffort;

	@OneToMany(fetch = FetchType.EAGER)
	private Set<Course> prerequisites;

	// @ManyToMany(fetch = FetchType.EAGER)
	@Column(name = "RECOMMENDED_BACKGROUND", columnDefinition = "TEXT")
	private String recommendedBackground;

	@Column(name = "CERTIFICATE")
	private String certificate;

	@Column(name = "TEXTBOOK")
	private String textbook;

	@Column(name = "COUNTRY")
	private String country;

	@Column(name = "PEER_ASSESMENT")
	private Boolean peerAssesment;

	@Column(name = "TEAM_PROJECT")
	private Boolean teamProjects;

	@Column(name = "EXAM")
	private Boolean exam;

	@Column(name = "VIDEO_LECTURE")
	private Boolean videoLectures;

	@Column(name = "FORUM")
	private Boolean forum;

	public Course() {
		super();
		// TODO Auto-generated constructor stub
	}

	public String getCourseDescription() {
		return courseDescription;
	}

	public void setCourseDescription(String courseDescription) {
		this.courseDescription = courseDescription;
	}

	public Integer getCourseId() {
		return courseId;
	}

	public void setCourseId(Integer courseId) {
		this.courseId = courseId;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public Integer getRating() {
		return rating;
	}

	public void setRating(Integer rating) {
		this.rating = rating;
	}

	
	public Initiative getInitiative() {
		return initiative;
	}

	public void setInitiative(Initiative initiative) {
		this.initiative = initiative;
	}

	public Institution getInstitution() {
		return institution;
	}

	public void setInstitution(Institution institution) {
		this.institution = institution;
	}

	public Instructor getInstructor() {
		return instructor;
	}

	public void setInstructor(Instructor instructor) {
		this.instructor = instructor;
	}

	public Set<SemanticTag> getCategories() {
		return categories;
	}

	public void setCategories(Set<SemanticTag> categories) {
		this.categories = categories;
	}

	public String getLanguages() {
		return languages;
	}

	public void setLanguages(String languages) {
		this.languages = languages;
	}

	public Set<Comment> getComments() {
		return comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

	/*
	public Set<Rating> getRatings() {
		return ratings;
	}

	public void setRatings(Set<Rating> ratings) {
		this.ratings= ratings;
	}
*/
	
	public String getStartingDate() {

		return startingDate;
	}

	public void setStartingDate(String startingDate) {
		this.startingDate = startingDate;
	}

	public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getLength() {
		return length;
	}

	public void setLength(String length) {
		this.length = length;
	}

	public String getEstimatedEffort() {
		return estimatedEffort;
	}

	public void setEstimatedEffort(String estimatedEffort) {
		this.estimatedEffort = estimatedEffort;
	}

	public Set<Course> getPrerequisites() {
		return prerequisites;
	}

	public void setPrerequisites(Set<Course> prerequisites) {
		this.prerequisites = prerequisites;
	}

	public String getRecommendedBackground() {
		return recommendedBackground;
	}

	public void setRecommendedBackground(String recommendedBackground) {
		this.recommendedBackground = recommendedBackground;
	}

	public String getCertificate() {
		return certificate;
	}

	public void setCertificate(String certificate) {
		this.certificate = certificate;
	}

	public String getTextbook() {
		return textbook;
	}

	public void setTextbook(String textbook) {
		this.textbook = textbook;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public Boolean isPeerAssesment() {
		return peerAssesment;
	}

	public void setPeerAssesment(Boolean peerAssesment) {
		this.peerAssesment = peerAssesment;
	}

	public Boolean isTeamProjects() {
		return teamProjects;
	}

	public void setTeamProjects(Boolean teamProjects) {
		this.teamProjects = teamProjects;
	}

	public Boolean isExam() {
		return exam;
	}

	public void setExam(Boolean exam) {
		this.exam = exam;
	}

	public Boolean isVideoLectures() {
		return videoLectures;
	}

	public void setVideoLectures(Boolean videoLectures) {
		this.videoLectures = videoLectures;
	}

	public Boolean isForum() {
		return forum;
	}

	public void setForum(Boolean forum) {
		this.forum = forum;
	}

}
